<html>
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    <script type="text/javascript">
    function actionFromNative(){
         document.getElementById("log_msg").innerHTML +=
             "<br\>Native调用了js函数";
    }

    function actionFromNativeWithParam(arg){
         document.getElementById("log_msg").innerHTML +=
             ("<br\>Native调用了js函数并传递参数："+arg);
    }

    function postStr(){
        var rtn = window.wx.actionFromJsWithParamBack('come from Js');
         document.getElementById("log_msg").innerHTML +=
             ("<br\>Native调用了js函数并传递参数并返回参数："+rtn);
    }

    </script>
</head>
<body>
<p>WebView与Javascript交互</p>
<div>
    <button onClick="window.wx.actionFromJs()">点击调用Native代码</button>
</div>
<br/>
<div>
    <button onClick="window.wx.actionFromJsWithParam('come from Js')">点击调用Native代码并传递参数</button>
</div>
<br/>
<div>
    <button onClick="postStr()">点击调用Native代码并传递参数并返回参数</button>
</div>

<br/>
<div id="log_msg">调用打印信息</div>
</body>
</html>